package br.com.array.android.ma.controller.alarmes;

import br.com.array.android.ma.model.DemandaReativo;

/**
 * Created by santosmgbh on 08/08/14.
 */
public class DemandaReativoBO implements IAlarmeBO<DemandaReativo> {

    @Override
    public boolean alarmar(DemandaReativo alarme) {
        boolean alarmar = false;
        DemandaReativo demanda = getDadoModelo();
        double dr = demanda.getPotAtivTotal() * (0.92 / demanda.getFpTotal()) - demanda.getAtivaTotalMaxima();
        if (dr > 0) {
            alarmar = true;
        }
        return alarmar;
    }

    @Override
    public DemandaReativo getDadoModelo() {
        return new DemandaReativo(); //Todo: buscar rest
    }

}
